package com.copa.module.goods.controller;

import com.copa.domain.ResponseDto;
import com.copa.module.goods.domain.dto.CategoryListDto;
import com.copa.module.goods.service.CategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author copa
 * @createDate 2021-01-14 9:19
 * @function
 */
@RestController
@Api(tags = {"类目接口"})
public class CategoryController {

    @Autowired
    private CategoryService categoryService;

    @GetMapping("/category/indexList")
    @ApiOperation(value = "首页类目列表")
    public ResponseDto<List<CategoryListDto>> indexList() {
        return categoryService.indexList();
    }

    @GetMapping("/category/list")
    @ApiOperation(value = "首页类目列表")
    public ResponseDto<List<CategoryListDto>> list() {
        return categoryService.list();
    }
}
